import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:mall/constant/app_colors.dart';
import 'package:mall/gen/r.dart';
import 'package:mall/utils/image_component/image_component.dart';

class APPScaffold extends StatelessWidget {
  const APPScaffold({
    super.key,
    required this.body,
    this.title,
    this.actions,
    this.bottomNavigationBar,
    this.leading, this.leadingWidth,
  });
  final Widget body;
  final String? title;
  final double? leadingWidth;
  final Widget? leading;
  final List<Widget>? actions;
  final Widget? bottomNavigationBar;
  @override
  Widget build(BuildContext context) {
    return Container(
      color: AppColors.C_F7F8FA,
      child: Stack(
        children: [
          ImageComponent(
            R.image.bgDefault.path,
            width: double.infinity,
            height: 292.w,
          ),
          Scaffold(
            backgroundColor: Colors.transparent,
            appBar: AppBar(
              title: title == null ? null : Text(title!),
              actions: actions,
              backgroundColor: Colors.transparent,
              leading: leading,
              leadingWidth: leadingWidth,
            ),
            body: body,
            bottomNavigationBar: bottomNavigationBar,
          ),
        ],
      ),
    );
  }
}
